//
//  FGImageMessageCellData.h
//  FGChatKit
//
//  Created by Henry on 2021/6/3.
//

#import "FGMessageCellData.h"

NS_ASSUME_NONNULL_BEGIN

/// 图像类别枚举
typedef NS_ENUM(NSInteger, FGImageType) {
    FGImageTypeThumb,     // 缩略图
    FGImageTypeLarge,     // 大图
    FGImageTypeOrigin,    // 原图
};

@interface FGImageItem : NSObject

@property (nonatomic, strong) NSString *uuid;
@property (nonatomic, strong) NSString *url;

@property (nonatomic) CGSize size;

@property (nonatomic) FGImageType type;

- (NSString *)getImageFileName;
- (NSString *)getImagePath:(NSString *)convsationId;

- (void)downloadPath:(NSString *)path progress:(FGDownloadProgress)progress succ:(FGSucc)succ fail:(FGFail)fail;

@end

@interface FGImageMessageCellData : FGMessageCellData

@property (nonatomic, strong) NSString *path;

@property (nonatomic, strong) UIImage *thumbImage;

@property (nonatomic, assign) NSUInteger thumbProgress;
@property (nonatomic, assign) NSUInteger uploadProgress;


@property (nonatomic, strong) NSMutableArray <FGImageItem *> *items;

- (void)loadImage;
- (void)loadImage:(FGImageType)type;

- (id)getThumbImage;
- (id)getOriginImage;
- (id)getPreviewImage;

@end

NS_ASSUME_NONNULL_END
